<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/9/19
  Time: 14:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>application作用域</title>
</head>
<body>
    <%
        //1. 定义图书列表
        List<String> books = new ArrayList<String>();
        books.add("《三国演义》");
        books.add("《水浒传》");
        books.add("《西游记》");
        books.add("《红楼梦》");
        //2. 将数据放到session作用域：
        application.setAttribute("books",books);
        //3. 转发到其它页面
        // request.getRequestDispatcher("/list_books.jsp").forward(request,response);
        //4. 使用重定向
        response.sendRedirect("/list_books.jsp");
    %>
</body>
</html>
